package Chapter2.Comparing.c3;

public class Practice3 {
    public static void main(String[] args) {
        int i = getTime("abkkcadkabkebfkabkskab","abk");
        System.out.println(i);
    }

    public static int getTime(String str1, String str2) {
        int count = 0;
        int len;
        while ((len = str1.indexOf(str2)) != -1) {
            count++;
            str1 = str1.substring(len + str2.length());
        }
        return count;
    }
}
